/******************************************************************************* * Copyright (c) 2012, Project: FP7-ICT-257930 Aniketos * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * * - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * - Neither the name of institution nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************/ /** */ package eu.aniketos.mtm.idm.model.idm.impl; import eu.aniketos.mtm.idm.model.idm.*; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EDataType; import org.eclipse.emf.ecore.EObject; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.impl.EFactoryImpl; import org.eclipse.emf.ecore.plugin.EcorePlugin; /** * <!-- begin-user-doc --> * An implementation of the model <b>Factory</b>. * <!-- end-user-doc --> * @generated */ public class IdmFactoryImpl extends EFactoryImpl implements IdmFactory { /** * Creates the default factory implementation. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public static IdmFactory init() { try { IdmFactory theIdmFactory = (IdmFactory)EPackage.Registry.INSTANCE.getEFactory("idm_v1"); if (theIdmFactory != null) { return theIdmFactory; } } catch (Exception exception) { EcorePlugin.INSTANCE.log(exception); } return new IdmFactoryImpl(); } /** * Creates an instance of the factory. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IdmFactoryImpl() { super(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public EObject create(EClass eClass) { switch (eClass.getClassifierID()) { case IdmPackage.DOCUMENT_ROOT: return createDocumentRoot(); case IdmPackage.IDM_TYPE: return createIdmType(); case IdmPackage.ROLES: return createRoles(); case IdmPackage.USERS: return createUsers(); default: throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier"); } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object createFromString(EDataType eDataType, String initialValue) { switch (eDataType.getClassifierID()) { case IdmPackage.TYPE_TYPE: return createTypeTypeFromString(eDataType, initialValue); case IdmPackage.TYPE_TYPE_OBJECT: return createTypeTypeObjectFromString(eDataType, initialValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String convertToString(EDataType eDataType, Object instanceValue) { switch (eDataType.getClassifierID()) { case IdmPackage.TYPE_TYPE: return convertTypeTypeToString(eDataType, instanceValue); case IdmPackage.TYPE_TYPE_OBJECT: return convertTypeTypeObjectToString(eDataType, instanceValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public DocumentRoot createDocumentRoot() { DocumentRootImpl documentRoot = new DocumentRootImpl(); return documentRoot; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IdmType createIdmType() { IdmTypeImpl idmType = new IdmTypeImpl(); return idmType; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Roles createRoles() { RolesImpl roles = new RolesImpl(); return roles; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Users createUsers() { UsersImpl users = new UsersImpl(); return users; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public TypeType createTypeTypeFromString(EDataType eDataType, String initialValue) { TypeType result = TypeType.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertTypeTypeToString(EDataType eDataType, Object instanceValue) { return instanceValue == null ? null : instanceValue.toString(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public TypeType createTypeTypeObjectFromString(EDataType eDataType, String initialValue) { return createTypeTypeFromString(IdmPackage.Literals.TYPE_TYPE, initialValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertTypeTypeObjectToString(EDataType eDataType, Object instanceValue) { return convertTypeTypeToString(IdmPackage.Literals.TYPE_TYPE, instanceValue); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public IdmPackage getIdmPackage() { return (IdmPackage)getEPackage(); } /** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @deprecated * @generated */ @Deprecated public static IdmPackage getPackage() { return IdmPackage.eINSTANCE; } } //IdmFactoryImpl